package com.ding.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.neo4j.ogm.session.Session;
import org.springframework.beans.factory.annotation.Autowired;

import com.ding.pojo.User;

public class UserRepositoryImpl {

	@Autowired
	Session session;
	public List<User> findUserByRelationship(String relationship){
		final String cypher = "match (user:User) -[r]->(any) where type(r) = {relationship} return user";
		Map<String, String> map =new HashMap<>();
		map.put("relationship", relationship);
		return (List<User>) session.query(User.class,cypher, map);
	}
}
